<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./http.js"></script>
</head>
<body>
    <script>
        let obj={
            name:"哈撒给"
        }
        // get请求
        http.get('http://139.9.177.51:3333/api/testGet',obj,function(res){
            console.log(res);
        });
        //post请求
        http.post('http://139.9.177.51:3333/api/testPost',obj,function(res){
            console.log(res);
        });
        //ajax综合万能请求
        http.ajax({
            type:"get",
            url:"http://139.9.177.51:3333/api/testGet",
            data:obj,
            sucess:function(res){
                console.log("ajax万能方式get请求成功",res);
            }
        })

        http.ajax({
            type:"post",
            url:"http://139.9.177.51:3333/api/testPost",
            data:obj,
            sucess:function(res){
                console.log("ajax万能方式post请求成功",res);
            }
        })
    </script>
</body>
</html>